<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 微信接收消息记录
 */
class CreateWechatRecordMsg extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wechat_record_msg', function (Blueprint $table) {
            $table->increments('id');
            $table->string('fromUserName',100)->default('')->comment('消息来源方');
            $table->string('toUserName',100)->default('')->comment('消息接收方');
            $table->string('msgId',100)->default('')->comment('微信消息ID');
            $table->string('msgType')->default('')->comment('消息类型 text event image voice video');
            $table->text('content')->nullable()->comment('内容');
            $table->string('mediaUrl')->default('')->comment('微信媒体资源url');
            $table->string('mediaId')->default('')->comment('微信媒体资源Id');
            $table->string('thumbMediaId')->default('')->comment('微信媒体缩略图资源Id');
            $table->string('mediaFormat')->default('')->comment('微信媒体资源格式');
            $table->string('lat')->default('')->comment('纬度');
            $table->string('lon')->default('')->comment('经度');
            $table->tinyInteger('isExecute')->default(0)->comment('数据是否被处理过');            
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('wechat_record_msg');
    }
}
